#include "../StdInc.h"

namespace GSTrader
{
	namespace TradeBase
	{
		//	static boost::atomic_int s_nLegId(0);
		CLeg::CLeg(CFrameworkBase* pFramework) : m_nInstrumentId(-1), m_dWeight(0), m_pFramework(pFramework), m_nParentId(-1)
		{
			//m_nId = s_nLegId++;
			m_bMain = false;
			m_nIndex = -1;
			m_pInstrument = NULL;
			m_nSide = osNone;
			m_pData = NULL;

			m_strExchangeId = "";
			m_strInstrumentId = "";
		}

		CLeg::~CLeg()
		{

		}

		CLeg::CLeg(CInstrument* pInstrument, double dWeight) : m_nInstrumentId(-1), m_dWeight(dWeight)
		{
			m_pFramework = NULL;
			m_pInstrument = pInstrument;

			if (pInstrument)
			{
				m_nInstrumentId = pInstrument->m_nID;
				m_nParentId = pInstrument->m_nParentId;
				m_strExchangeId = pInstrument->m_strExchangeID;
				m_strInstrumentId = pInstrument->m_strSymbol;
			}
		}
	}
}